home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tcl7.4p2.patch < prev    next >
Text File  |  1995-09-18  |  15KB  |  515 lines

  1. Prereq: "7.4p1"
  2. *** ../tcl7.4p1/patchlevel.h    Fri Jul 28 10:08:25 1995
  3. --- patchlevel.h    Mon Sep 18 11:41:25 1995
  4. ***************
  5. *** 17,23 ****
  6.    * See the file "license.terms" for information on usage and redistribution
  7.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8.    *
  9. !  * @(#) patchlevel.h 1.10 95/07/28 10:08:24
  10.    */
  11.   
  12. ! #define TCL_PATCH_LEVEL "7.4p1"
  13. --- 17,23 ----
  14.    * See the file "license.terms" for information on usage and redistribution
  15.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  16.    *
  17. !  * @(#) patchlevel.h 1.11 95/09/18 11:41:22
  18.    */
  19.   
  20. ! #define TCL_PATCH_LEVEL "7.4p2"
  21. *** ../tcl7.4p1/./tclBasic.c    Tue Jul 25 13:01:45 1995
  22. --- ./tclBasic.c    Tue Sep  5 11:37:35 1995
  23. ***************
  24. *** 12,18 ****
  25.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  26.    */
  27.   
  28. ! static char sccsid[] = "@(#) tclBasic.c 1.169 95/07/25 13:01:44";
  29.   
  30.   #include "tclInt.h"
  31.   #ifndef TCL_GENERIC_ONLY
  32. --- 12,18 ----
  33.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  34.    */
  35.   
  36. ! static char sccsid[] = "@(#) tclBasic.c 1.171 95/09/05 11:37:34";
  37.   
  38.   #include "tclInt.h"
  39.   #ifndef TCL_GENERIC_ONLY
  40. ***************
  41. *** 210,215 ****
  42. --- 210,216 ----
  43.           cmdPtr->clientData = (ClientData) NULL;
  44.           cmdPtr->deleteProc = NULL;
  45.           cmdPtr->deleteData = (ClientData) NULL;
  46. +         cmdPtr->deleted = 0;
  47.           Tcl_SetHashValue(hPtr, cmdPtr);
  48.       }
  49.       }
  50. ***************
  51. *** 435,444 ****
  52.       for (hPtr = Tcl_FirstHashEntry(&iPtr->commandTable, &search);
  53.           hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
  54.       cmdPtr = (Command *) Tcl_GetHashValue(hPtr);
  55. !     if (cmdPtr->deleteProc != NULL) { 
  56. !         (*cmdPtr->deleteProc)(cmdPtr->deleteData);
  57.       }
  58. -     ckfree((char *) cmdPtr);
  59.       }
  60.       Tcl_DeleteHashTable(&iPtr->commandTable);
  61.       for (hPtr = Tcl_FirstHashEntry(&iPtr->mathFuncTable, &search);
  62. --- 436,448 ----
  63.       for (hPtr = Tcl_FirstHashEntry(&iPtr->commandTable, &search);
  64.           hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
  65.       cmdPtr = (Command *) Tcl_GetHashValue(hPtr);
  66. !     if (!cmdPtr->deleted) {
  67. !         cmdPtr->deleted = 1;
  68. !         if (cmdPtr->deleteProc != NULL) {
  69. !         (*cmdPtr->deleteProc)(cmdPtr->deleteData);
  70. !         }
  71. !         ckfree((char *) cmdPtr);
  72.       }
  73.       }
  74.       Tcl_DeleteHashTable(&iPtr->commandTable);
  75.       for (hPtr = Tcl_FirstHashEntry(&iPtr->mathFuncTable, &search);
  76. ***************
  77. *** 533,538 ****
  78. --- 537,550 ----
  79.       Tcl_HashEntry *hPtr;
  80.       int new;
  81.   
  82. +     if (iPtr->flags & DELETED) {
  83. +     /*
  84. +      * The interpreter is being deleted.  Don't create any new
  85. +      * commands;  it's not safe to muck with the interpreter anymore.
  86. +      */
  87. +     return (Tcl_Command) NULL;
  88. +     }
  89.       hPtr = Tcl_CreateHashEntry(&iPtr->commandTable, cmdName, &new);
  90.       if (!new) {
  91.       /*
  92. ***************
  93. *** 539,557 ****
  94.        * Command already exists:  delete the old one.
  95.        */
  96.   
  97. !     cmdPtr = (Command *) Tcl_GetHashValue(hPtr);
  98. !     if (cmdPtr->deleteProc != NULL) {
  99. !         (*cmdPtr->deleteProc)(cmdPtr->deleteData);
  100. !     }
  101. !     } else {
  102. !     cmdPtr = (Command *) ckalloc(sizeof(Command));
  103. !     Tcl_SetHashValue(hPtr, cmdPtr);
  104.       }
  105.       cmdPtr->hPtr = hPtr;
  106.       cmdPtr->proc = proc;
  107.       cmdPtr->clientData = clientData;
  108.       cmdPtr->deleteProc = deleteProc;
  109.       cmdPtr->deleteData = clientData;
  110.       return (Tcl_Command) cmdPtr;
  111.   }
  112.   
  113. --- 551,576 ----
  114.        * Command already exists:  delete the old one.
  115.        */
  116.   
  117. !     Tcl_DeleteCommand(interp, Tcl_GetHashKey(&iPtr->commandTable, hPtr));
  118. !     hPtr = Tcl_CreateHashEntry(&iPtr->commandTable, cmdName, &new);
  119. !     if (!new) {
  120. !         /*
  121. !          * Drat.  The stupid deletion callback recreated the command.
  122. !          * Just throw away the new command (if we try to delete it again,
  123. !          * we could get stuck in an infinite loop).
  124. !          */
  125. !          ckfree((char  *) Tcl_GetHashValue(hPtr));
  126. !      }
  127.       }
  128. +     cmdPtr = (Command *) ckalloc(sizeof(Command));
  129. +     Tcl_SetHashValue(hPtr, cmdPtr);
  130.       cmdPtr->hPtr = hPtr;
  131.       cmdPtr->proc = proc;
  132.       cmdPtr->clientData = clientData;
  133.       cmdPtr->deleteProc = deleteProc;
  134.       cmdPtr->deleteData = clientData;
  135. +     cmdPtr->deleted = 0;
  136.       return (Tcl_Command) cmdPtr;
  137.   }
  138.   
  139. ***************
  140. *** 699,704 ****
  141. --- 718,732 ----
  142.       Tcl_HashEntry *hPtr;
  143.       Command *cmdPtr;
  144.   
  145. +     if (iPtr->flags & DELETED) {
  146. +     /*
  147. +      * The interpreter is being deleted, so this command has already
  148. +      * been deleted, or will be soon.  It's not safe to muck with the
  149. +      * interpreter anymore.
  150. +      */
  151. +     return -1;
  152. +     }
  153.       hPtr = Tcl_FindHashEntry(&iPtr->commandTable, cmdName);
  154.       if (hPtr == NULL) {
  155.       return -1;
  156. ***************
  157. *** 706,719 ****
  158.       cmdPtr = (Command *) Tcl_GetHashValue(hPtr);
  159.   
  160.       /*
  161. !      * Delete the hash table entry before invoking the deletion callback;
  162. !      * otherwise the callback could delete the command a second time, or
  163. !      * create a new command on top of the one we're deleting.
  164.        */
  165.   
  166. !     Tcl_DeleteHashEntry(hPtr);
  167.       if (cmdPtr->deleteProc != NULL) {
  168.       (*cmdPtr->deleteProc)(cmdPtr->deleteData);
  169.       }
  170.       ckfree((char *) cmdPtr);
  171.       return 0;
  172. --- 734,772 ----
  173.       cmdPtr = (Command *) Tcl_GetHashValue(hPtr);
  174.   
  175.       /*
  176. !      * The code here is tricky.  We can't delete the hash table entry
  177. !      * before invoking the deletion callback because there are cases
  178. !      * where the deletion callback needs to invoke the command (e.g.
  179. !      * object systems such as OTcl).  However, this means that the
  180. !      * callback could try to delete or rename the command.  The deleted
  181. !      * flag allows us to detect these cases and skip nested deletes.
  182.        */
  183.   
  184. !     if (cmdPtr->deleted) {
  185. !     /*
  186. !      * Another deletion is already in progress.  Remove the hash
  187. !      * table entry now, but don't invoke a callback or free the
  188. !      * command structure.
  189. !      */
  190. !     Tcl_DeleteHashEntry(hPtr);
  191. !     cmdPtr->hPtr = NULL;
  192. !     return 0;
  193. !     }
  194. !     cmdPtr->deleted = 1;
  195.       if (cmdPtr->deleteProc != NULL) {
  196.       (*cmdPtr->deleteProc)(cmdPtr->deleteData);
  197. +     }
  198. +     /*
  199. +      * Don't use hPtr to delete the hash entry here, because it's
  200. +      * possible that the deletion callback renamed the command.
  201. +      * Instead, use cmdPtr->hptr, and make sure that no-one else
  202. +      * has already deleted the hash entry.
  203. +      */
  204. +     if (cmdPtr->hPtr != NULL) {
  205. +     Tcl_DeleteHashEntry(cmdPtr->hPtr);
  206.       }
  207.       ckfree((char *) cmdPtr);
  208.       return 0;
  209. *** ../tcl7.4p1/./tclCmdMZ.c    Sun Apr 30 14:35:16 1995
  210. --- ./tclCmdMZ.c    Fri Aug  4 09:57:59 1995
  211. ***************
  212. *** 14,20 ****
  213.    */
  214.   
  215.   #ifndef lint
  216. ! static char sccsid[] = "@(#) tclCmdMZ.c 1.57 95/04/30 14:35:17";
  217.   #endif
  218.   
  219.   #include "tclInt.h"
  220. --- 14,20 ----
  221.    */
  222.   
  223.   #ifndef lint
  224. ! static char sccsid[] = "@(#) tclCmdMZ.c 1.58 95/08/04 09:58:00";
  225.   #endif
  226.   
  227.   #include "tclInt.h"
  228. ***************
  229. *** 122,128 ****
  230.       pattern = Tcl_DStringValue(&patternDString);
  231.       for (p = pattern; *p != 0; p++) {
  232.           if (isupper(UCHAR(*p))) {
  233. !         *p = tolower(*p);
  234.           }
  235.       }
  236.       Tcl_DStringInit(&stringDString);
  237. --- 122,128 ----
  238.       pattern = Tcl_DStringValue(&patternDString);
  239.       for (p = pattern; *p != 0; p++) {
  240.           if (isupper(UCHAR(*p))) {
  241. !         *p = tolower(UCHAR(*p));
  242.           }
  243.       }
  244.       Tcl_DStringInit(&stringDString);
  245. ***************
  246. *** 130,136 ****
  247.       string = Tcl_DStringValue(&stringDString);
  248.       for (p = string; *p != 0; p++) {
  249.           if (isupper(UCHAR(*p))) {
  250. !         *p = tolower(*p);
  251.           }
  252.       }
  253.       } else {
  254. --- 130,136 ----
  255.       string = Tcl_DStringValue(&stringDString);
  256.       for (p = string; *p != 0; p++) {
  257.           if (isupper(UCHAR(*p))) {
  258. !         *p = tolower(UCHAR(*p));
  259.           }
  260.       }
  261.       } else {
  262. ***************
  263. *** 270,276 ****
  264.       pattern = Tcl_DStringValue(&patternDString);
  265.       for (p = pattern; *p != 0; p++) {
  266.           if (isupper(UCHAR(*p))) {
  267. !         *p = tolower(*p);
  268.           }
  269.       }
  270.       Tcl_DStringInit(&stringDString);
  271. --- 270,276 ----
  272.       pattern = Tcl_DStringValue(&patternDString);
  273.       for (p = pattern; *p != 0; p++) {
  274.           if (isupper(UCHAR(*p))) {
  275. !         *p = tolower(UCHAR(*p));
  276.           }
  277.       }
  278.       Tcl_DStringInit(&stringDString);
  279. ***************
  280. *** 278,284 ****
  281.       string = Tcl_DStringValue(&stringDString);
  282.       for (p = string; *p != 0; p++) {
  283.           if (isupper(UCHAR(*p))) {
  284. !         *p = tolower(*p);
  285.           }
  286.       }
  287.       } else {
  288. --- 278,284 ----
  289.       string = Tcl_DStringValue(&stringDString);
  290.       for (p = string; *p != 0; p++) {
  291.           if (isupper(UCHAR(*p))) {
  292. !         *p = tolower(UCHAR(*p));
  293.           }
  294.       }
  295.       } else {
  296. ***************
  297. *** 1134,1140 ****
  298.       Tcl_SetResult(interp, argv[2], TCL_VOLATILE);
  299.       for (p = interp->result; *p != 0; p++) {
  300.           if (isupper(UCHAR(*p))) {
  301. !         *p = tolower(*p);
  302.           }
  303.       }
  304.       return TCL_OK;
  305. --- 1134,1140 ----
  306.       Tcl_SetResult(interp, argv[2], TCL_VOLATILE);
  307.       for (p = interp->result; *p != 0; p++) {
  308.           if (isupper(UCHAR(*p))) {
  309. !         *p = tolower(UCHAR(*p));
  310.           }
  311.       }
  312.       return TCL_OK;
  313. ***************
  314. *** 1150,1156 ****
  315.       Tcl_SetResult(interp, argv[2], TCL_VOLATILE);
  316.       for (p = interp->result; *p != 0; p++) {
  317.           if (islower(UCHAR(*p))) {
  318. !         *p = toupper(*p);
  319.           }
  320.       }
  321.       return TCL_OK;
  322. --- 1150,1156 ----
  323.       Tcl_SetResult(interp, argv[2], TCL_VOLATILE);
  324.       for (p = interp->result; *p != 0; p++) {
  325.           if (islower(UCHAR(*p))) {
  326. !         *p = toupper(UCHAR(*p));
  327.           }
  328.       }
  329.       return TCL_OK;
  330. *** ../tcl7.4p1/./tclVar.c    Fri Jun  2 09:29:15 1995
  331. --- ./tclVar.c    Fri Aug  4 09:38:17 1995
  332. ***************
  333. *** 14,20 ****
  334.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  335.    */
  336.   
  337. ! static char sccsid[] = "@(#) tclVar.c 1.61 95/06/02 09:29:16";
  338.   
  339.   #include "tclInt.h"
  340.   #include "tclPort.h"
  341. --- 14,20 ----
  342.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  343.    */
  344.   
  345. ! static char sccsid[] = "@(#) tclVar.c 1.62 95/08/04 09:38:18";
  346.   
  347.   #include "tclInt.h"
  348.   #include "tclPort.h"
  349. ***************
  350. *** 2016,2022 ****
  351.                        * indicates what's happening to
  352.                        * variable, plus other stuff like
  353.                        * TCL_GLOBAL_ONLY and
  354. !                      * TCL_INTERP_DESTROYED. */
  355.   {
  356.       register VarTrace *tracePtr;
  357.       ActiveVarTrace active;
  358. --- 2016,2025 ----
  359.                        * indicates what's happening to
  360.                        * variable, plus other stuff like
  361.                        * TCL_GLOBAL_ONLY and
  362. !                      * TCL_INTERP_DESTROYED.   May also
  363. !                      * contain PART1_NOT_PARSEd, which
  364. !                      * should not be passed through
  365. !                      * to callbacks. */
  366.   {
  367.       register VarTrace *tracePtr;
  368.       ActiveVarTrace active;
  369. ***************
  370. *** 2069,2075 ****
  371.           }
  372.       }
  373.       }
  374.   
  375.       /*
  376.        * Invoke traces on the array containing the variable, if relevant.
  377. --- 2072,2078 ----
  378.           }
  379.       }
  380.       }
  381. !     flags &= ~PART1_NOT_PARSED;
  382.   
  383.       /*
  384.        * Invoke traces on the array containing the variable, if relevant.
  385. *** ../tcl7.4p1/./tclUnixUtil.c    Sat Jul 22 17:31:37 1995
  386. --- ./tclUnixUtil.c    Mon Aug 28 08:57:36 1995
  387. ***************
  388. *** 16,22 ****
  389.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  390.    */
  391.   
  392. ! static char sccsid[] = "@(#) tclUnixUtil.c 1.56 95/07/22 17:31:36";
  393.   
  394.   #include "tclInt.h"
  395.   #include "tclPort.h"
  396. --- 16,22 ----
  397.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  398.    */
  399.   
  400. ! static char sccsid[] = "@(#) tclUnixUtil.c 1.57 95/08/28 08:57:37";
  401.   
  402.   #include "tclInt.h"
  403.   #include "tclPort.h"
  404. ***************
  405. *** 691,696 ****
  406. --- 691,699 ----
  407.           goto error;
  408.       }
  409.       execName = Tcl_TildeSubst(interp, argv[firstArg], &buffer);
  410. +     if (execName == NULL) {
  411. +         goto error;
  412. +     }
  413.       pid = vfork();
  414.       if (pid == 0) {
  415.           if (((inputId != -1) && (dup2(inputId, 0) == -1))
  416. *** ../tcl7.4p1/./tclInt.h    Wed Jun 28 09:36:24 1995
  417. --- ./tclInt.h    Fri Aug 25 15:44:50 1995
  418. ***************
  419. *** 9,15 ****
  420.    * See the file "license.terms" for information on usage and redistribution
  421.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  422.    *
  423. !  * @(#) tclInt.h 1.105 95/06/28 09:36:23
  424.    */
  425.   
  426.   #ifndef _TCLINT
  427. --- 9,15 ----
  428.    * See the file "license.terms" for information on usage and redistribution
  429.    * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  430.    *
  431. !  * @(#) tclInt.h 1.106 95/08/25 15:44:50
  432.    */
  433.   
  434.   #ifndef _TCLINT
  435. ***************
  436. *** 415,421 ****
  437.       Tcl_HashEntry *hPtr;    /* Pointer to the hash table entry in
  438.                    * interp->commandTable that refers to
  439.                    * this command.  Used to get a command's
  440. !                  * name from its Tcl_Command handle. */
  441.       Tcl_CmdProc *proc;        /* Procedure to process command. */
  442.       ClientData clientData;    /* Arbitrary value to pass to proc. */
  443.       Tcl_CmdDeleteProc *deleteProc;
  444. --- 415,425 ----
  445.       Tcl_HashEntry *hPtr;    /* Pointer to the hash table entry in
  446.                    * interp->commandTable that refers to
  447.                    * this command.  Used to get a command's
  448. !                  * name from its Tcl_Command handle.  NULL
  449. !                  * means that the hash table entry has
  450. !                  * been removed already (this can happen
  451. !                  * if deleteProc causes the command to be
  452. !                  * deleted or recreated). */
  453.       Tcl_CmdProc *proc;        /* Procedure to process command. */
  454.       ClientData clientData;    /* Arbitrary value to pass to proc. */
  455.       Tcl_CmdDeleteProc *deleteProc;
  456. ***************
  457. *** 423,428 ****
  458. --- 427,436 ----
  459.                    * command. */
  460.       ClientData deleteData;    /* Arbitrary value to pass to deleteProc
  461.                    * (usually the same as clientData). */
  462. +     int deleted;        /* Means that the command is in the process
  463. +                  * of being deleted (its deleteProc is
  464. +                  * currently executing).  Any other attempts
  465. +                  * to delete the command should be ignored. */
  466.   } Command;
  467.   
  468.   /*
  469. *** ../tcl7.4p1/./changes    Fri Jul 28 10:20:44 1995
  470. --- ./changes    Mon Sep 18 11:04:09 1995
  471. ***************
  472. *** 1,6 ****
  473.   Recent user-visible changes to Tcl:
  474.   
  475. ! sccsid = %Z% %M% %I% %E% %U%
  476.   
  477.   1. No more [command1] [command2] construct for grouping multiple
  478.   commands on a single command line.
  479. --- 1,6 ----
  480.   Recent user-visible changes to Tcl:
  481.   
  482. ! sccsid = @(#) changes 1.16 95/09/18 11:04:07
  483.   
  484.   1. No more [command1] [command2] construct for grouping multiple
  485.   commands on a single command line.
  486. ***************
  487. *** 1242,1244 ****
  488. --- 1242,1260 ----
  489.   handle the case where endPtr == NULL.
  490.   
  491.   ----------------- Released patch 7.4p1, 7/29/95 -----------------------
  492. + 8/4/95 (bug fix) C-level trace callbacks for variables were sometimes
  493. + receiving the PART1_NOT_PARSED flag, which could cause errors in
  494. + subsequent Tcl library calls using the flags.
  495. + 8/4/95 (bug fix) Calls to toupper and tolower weren't using the
  496. + UCHAR macros, which caused trouble in non-U.S. locales. (JO)
  497. + 8/25/95 (bug fix) Undid change from 7/19, so that commands can stay
  498. + around while their deletion callbacks execute.  Added lots of code to
  499. + handle all of the reentrancy problems that this opens up.
  500. + 8/28/95 (bug fix) Exec wasn't handling bad user names properly, as
  501. + in "exec ~bogus_user/foo".
  502. + ----------------- Released patch 7.4p2, 9/19/95 -----------------------
  503.